<?php
    namespace app\admin\validate;
    use think\Validate;
    class Product extends Validate{
        protected $rule=[
            'shopname' =>'chsDash|min:15',
            'price' => 'require|number',
            'discount' => 'require|number',
            'stoke' => 'require|number',
            'detail' => 'require',
        ];
        protected $message=[
            'shopname.chsDash' => '产品名称只能由汉字、字母、数字和下划线_及破折号-组成',
            'shopname.min' => '产品名称最少五个字',
            'price.require' => '市场价不能为空',
            'discount.require' => '会员价不能为空',
            'stoke.require' => '库存不能为空',
            'detail.require' => '详情不能为空',
            'price.number' => '市场价必须是数字',
            'discount.number' => '会员价必须是数字',
            'stoke.number' => '库存必须是数字',
        ];
        protected $scene = [
            'check_phone' => ['phone']
        ];
    }

?>